<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>面向对象主要概念 - Autumoon - 博客园</title>
<meta name="keywords" content=".NET程序员技术面试迷你手册,C#版,面向对象主要概念">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/Autumoon/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/Autumoon/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html" id="Form1">
<div>
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>

        
<!--done-->
<div id="home">
<div id="header">
	<div id="blogTitle">
		
<!--done-->
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/Autumoon/">Autumoon</a></h1>
<h2><a href="http://www.autumoon.com/" target="_top" title="欢迎访问Autumoon Lab！">www.Autumoon.com</a></h2>



		
	</div><!--end: blogTitle 博客的标题和副标题 -->
	<div id="navigator">
		
<!--done-->
			<ul id="navList">
				<li></li>
				<li></li>
				<li><a href="http://home.cnblogs.com/">主页</a></li>
				<li><a href="http://home.cnblogs.com/ing/">闪存</a></li>				
				<li></li>
				<li><a id="MyLinks1_ContactLink" accesskey="9" class="menu" href="http://space.cnblogs.com/msg/send/Autumoon">联系</a></li>
				<li><a id="MyLinks1_Admin" class="menu" href="http://www.cnblogs.com/Autumoon/admin/EditPosts.aspx">管理</a></li>
				<li><a id="MyLinks1_Syndication" class="menu" href="http://www.cnblogs.com/Autumoon/rss">订阅</a>
				<a id="MyLinks1_XMLLink" class="aHeaderXML" href="http://www.cnblogs.com/Autumoon/rss"><img src="rss.gif" alt="订阅" style="border-width: 0px;"></a></li>
			</ul>


		<div class="blogStats">
			
			
<!--done-->
随笔-71&nbsp;
文章-0&nbsp;
评论-326&nbsp;

			
		</div><!--end: blogStats -->
	</div><!--end: navigator 博客导航栏 -->
</div><!--end: header 头部 -->
<div id="main">
	<div id="mainContent">
	<div class="forFlow">
		
					
<!--done-->
<div id="topics">
	<div class="post">
		<h1 class="postTitle">
			<a id="ctl04_TitleUrl" class="postTitle2" href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html">面向对象主要概念</a>
		</h1>
		<div class="clear"></div>
		<div class="postBody">
			<p><font size="2"><a href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270520.html">【回目录】</a></font></p>  <p><font size="2">说实话，面向对象是个很大很广的概念，我可不敢在园子里瞎白活，以免“误入牛群深处，引来砖头无数”。但是作为面试常考的题，又不得不列举出来，在此，我主要是和大家一起回顾一下面向对象中的几个核心概念，温故罢了，绝无它意。</font></p>  <p><font size="2">说到面向对象这个概念很大很广，其实我觉得也不必被这个“很大很广”吓着了，学习面向对象思想，切不可将其专门孤立为一门学科来学习，其实面向对象就在我们日常生活当中，随时随处都能见到，而不仅仅是软件开发。软件开发不过是把我们人类看待世界的思维方式总结抽象出来用到程序设计上，起了个名字叫“面向对象”，可千万别被专业术语给镇住了，IT人士有这毛病，喜欢故弄玄虚，其实例子太常见了，你家马桶就是面向对象的。</font></p>  <p><font size="2">面向对象有三个要素：封装（Encapsulation）、继承（Inheritance）和多态（Polymorphism）。把英文也写出来不是卖弄而是给大家伙儿提个醒，很多时候不错的公司面试往往会用英文，可千万别在词汇量上栽跟头，太不划算了。好，废话少说，接下来我们就来挨个儿探讨以上三个概念吧。</font></p>  <p><font size="2">什么是封装？面向对象思想有个忌讳，那就是把对象自己的属性和内部实现细节暴露给别的对象，虽是代码但也应该享有隐私权。把不想或者不该告诉别人的东西封起来，把可以告诉别人的公开，这就是封装的基本概念。那什么是该封装起来什么是该公开的呢？很简单，我们来看看下面这段代码：</font></p>  <div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">   <div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">     <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> Person</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   3:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">string</span> Name { get; <span style="color: rgb(0, 0, 255);">private</span> set; }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   4:</span>     <span style="color: rgb(0, 0, 255);">protected</span> <span style="color: rgb(0, 0, 255);">int</span> age = 0;</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   5:</span>&nbsp; </pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   6:</span>     <span style="color: rgb(0, 0, 255);">internal</span> <span style="color: rgb(0, 0, 255);">void</span> SetName(<span style="color: rgb(0, 0, 255);">string</span> name)</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   7:</span>     {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   8:</span>         <span style="color: rgb(0, 0, 255);">if</span> (String.IsNullOrEmpty(name))</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   9:</span>         {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  10:</span>             <span style="color: rgb(0, 0, 255);">return</span>;</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  11:</span>         }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  12:</span>&nbsp; </pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  13:</span>         <span style="color: rgb(0, 0, 255);">this</span>.Name = name;</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  14:</span>     }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  15:</span> }</pre>
  </div>
</div>

<p><font size="2">我们声明了一个Person类，里面有一个Name属性。注意，Name属性的访问器（get）是公开的，但设置器（set）是私有的，试想一个人如果走在大街上谁见了他都可以给他取个名字，那岂不乱了套了。但人又不能没有名字，所以有一个SetName的方法，前面说了名字不是谁都能取的，因此我们给这个方法加了一个internal访问修饰符，也就是说当前程序集里可以调用，我们把“当前程序集”设想成这个人所在的家庭，一个小孩子生下来，可能是爷爷奶奶给取名，也可能是爸爸妈妈取名。另外，还有个protected的age属性，女孩子的年龄往往是比较保密的，一个女的听到人家说：“啊，你都35了呀！”肯定不会开心的，所以保护起来，小心别让人知道为好。不论用什么访问修饰符，封装的目的就是根据类之间的关系与设计需要，把不该暴露出来包裹好，把可以让别的对象调用的公开，让对象在内存里活得井然有序。如果你有点儿拿捏不准什么是该暴露出来的什么是该封装起来的，那么你就联系到实际生活中的例子去想想。看看你家的马桶，放水的按钮是暴露出来的，但您按下按钮之后内部是如何运作把水放出来的，这就不用用户关心了，自然也就封装起来了，如果您还印象不够深，那就想想，马桶排水的管道应该暴露还是封装起来呢。</font></p>

<p><font size="2">也许有朋友会问，既然女孩子的年龄是隐私，那么为什么不干脆用private呢，这样岂不是封装得更彻底？嗯，只要private了，除了自己，谁都甭想知道。这比较适合犯罪记录，比如“private int _killedPeopleAmount;”我们之所以把age属性设为protected的，就是考虑到面向对象的另一个概念：继承。</font></p>

<p><font size="2">所谓“龙生龙，凤生凤，老鼠的儿子会打洞”。同类的事物，可以把公共的部分抽象出来放在基类中，子类去继承，就不用在每个子类中都单独声明了。如果把age设置为private，子类将不能继承，不符合面向对象的思想。请看下面这个类：</font></p>

<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
  <div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> Chinese : Person</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   3:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">object</span> HuKou { get; set; }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   4:</span> }</pre>
  </div>
</div>

<p><font size="2">我们把上面的Person类当作人类的基类，其中的Name和age以及SetName方法都是人类共同的地方，因此声明Chinese的时候只需要继承Person类就可以获得这些属性和方法，没必要自己再去重新声明一遍。精力用在刀刃上，考虑Chinese类的属性和方法的时候只需要考虑那些具有中国特色的就行了，例如户口。</font></p>

<p><font size="2">接下来我们来探讨探讨什么是多态。所谓多态，中国有句古话可以概括：龙生九子，种种不同。都是龙的儿子，又各有差别，不过这样说起来有点儿泛泛，只是辅助记忆而已，可千万别在这上面认死理儿。多态有两种表现方式，一是同一个类中有多个名字一样但签名不同的方法；二是子类改写父类中方法的内部实现。其实“龙生九子，种种不同”这个概括只能映射其中第二点表现方式，也就是virtual和override之间的关系。至于第一点嘛，可以追溯到多态的英文单词的起源，据说这个词来源于西方神话故事里一个叫Polymorph神，他具体从事什么工作不重要，关键是他有个特点，白天一个样晚上一个样，同一个人表现出不同的样子，人格分裂的典型临床症状，软件开发前辈将他抽象成面向对象中的“多态”，可以很好地解释方法重载。</font></p>

<p><font size="2">首先我们来看看方法重载：</font></p>

<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
  <div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> UserManager</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   3:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">object</span> GetUser(<span style="color: rgb(0, 0, 255);">int</span> id)</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   4:</span>     {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   5:</span>         <span style="color: rgb(0, 128, 0);">// TODO: Find this user instance by id.</span></pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   6:</span>         <span style="color: rgb(0, 0, 255);">return</span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 255);">object</span>();</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   7:</span>     }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   8:</span>&nbsp; </pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   9:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">object</span> GetUser(<span style="color: rgb(0, 0, 255);">string</span> name)</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  10:</span>     {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  11:</span>         <span style="color: rgb(0, 128, 0);">// TODO: Find this user instance by name.</span></pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  12:</span>         <span style="color: rgb(0, 0, 255);">return</span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 255);">object</span>();</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  13:</span>     }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  14:</span> }</pre>
  </div>
</div>

<p><font size="2">我们假设有UserManager这样一个工具类，提供了获取用户实例的机制，但又有两种方式，一是通过id另一种则是通过name，通过方法重载，我们只需要变动一下方法的入参数据类型从而改变了函数签名即可，没必要分别声明GetUserByID和GetUserByName两个方法，那样的话会让整个类在被调用时显得很臃肿，要不然像<a title="MessageBox..::.Show Method " href="http://msdn2.microsoft.com/dtkc6h4c.aspx">MessageBox.Show</a>这样提供21种重载方式的方法，对于开发者和设计者来说岂不都是噩梦？</font></p>

<p><font size="2">根据我的经验，面向对象在面试中主要考察的部分就是多态，而在多态中主要考察的就是virtual和override之间的关系。我们来看码说话吧：</font></p>

<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
  <div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> Dragon</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   3:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">virtual</span> <span style="color: rgb(0, 0, 255);">void</span> Fly()</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   4:</span>     {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   5:</span>         Console.WriteLine(<span style="color: rgb(0, 96, 128);">"I'm flying."</span>);</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   6:</span>     }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   7:</span> }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   8:</span>&nbsp; </pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   9:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> DragonSonA : Dragon</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  10:</span> {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  11:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">override</span> <span style="color: rgb(0, 0, 255);">void</span> Fly()</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  12:</span>     {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  13:</span>         <span style="color: rgb(0, 0, 255);">base</span>.Fly();</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  14:</span>     }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  15:</span> }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  16:</span>&nbsp; </pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  17:</span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">class</span> DragonSonB : Dragon</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  18:</span> {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  19:</span>     <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 255);">override</span> <span style="color: rgb(0, 0, 255);">void</span> Fly()</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  20:</span>     {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  21:</span>         Console.WriteLine(<span style="color: rgb(0, 96, 128);">"I can't fly."</span>);</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  22:</span>     }</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">  23:</span> }</pre>
  </div>
</div>

<p><font size="2">这段示例代码比较浅显易懂。我们声明了一个Dragon类，它有一个飞行的方法，因此它可以在天上随意地飞，它的儿子也会从他那里继承到这个飞翔的方法，但又“种种不同”，有的龙恐怕并不会飞，例如DragonSonB。甭管龙的儿子是不是都会飞吧，这段代码主要是展示一下，在父类中有的方法虽然会被子类继承，但将来在子类使用时可能有不同的实现机制，这时候就需要在父类中声明该方法时加上virtual关键字，以表示将来是可以改写的，在子类中需要则使用override关键字，表示儿子自有主见。</font></p>

<p><font size="2">很多时候面试官会围绕virtual和override问一些其它情况，例如如果父类里面的方法没有virtual关键字，光是子类里方法前有override关键字呢？这种情况不用多想，语法错误，就算面试官答应，编译器也不会答应的。需要注意的是，如果子类里继承的方法如果没有override关键字，会是怎样呢？当我们把DragonSonB.Fly方法前的override关键字去掉，这种情况编译器在编译的时候会默认在函数声明前面加上一个new关键字，这就阻断了继承链，也就是说DragonSonB.Fly和Dragon.Fly没有什么关系了，只不过方法名雷同而已。具体怎么体现呢？我们来试试下面的代码：</font></p>

<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
  <div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   1:</span> <span style="color: rgb(0, 0, 255);">static</span> <span style="color: rgb(0, 0, 255);">void</span> Main(<span style="color: rgb(0, 0, 255);">string</span>[] args)</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   2:</span> {</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   3:</span>     Dragon dragon = <span style="color: rgb(0, 0, 255);">new</span> DragonSonB();</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   4:</span>     dragon.Fly();</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   5:</span>&nbsp; </pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   6:</span>     Console.ReadLine();</pre>

    <pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(96, 96, 96);">   7:</span> }</pre>
  </div>
</div>

<p><font size="2">调用dragon.Fly方法时，编译器会顺着继承链往下找，一直找到合适的那个方法体。如果DragonSonB.Fly方法有override关键字，则说明它是从Dragon那儿继承来的，因此dragon.Fly实际上调用的是DragonSonB.Fly，输出结果就是“I can’t fly.”。但如果DragonSonB.Fly去掉了override关键字或者换成了new关键字，那么就意味着这个Fly方法不再是从Dragon那儿继承来的了，因此在调用dragon.Fly方法时，继承链就不能到达DragonSonB.Fly方法而只能停留在它的上一级，也就是调用Dragon.Fly方法。</font></p>

<p><font size="2">搞清楚了上面提到的概念，估计面试中面向对象尤其是多态部分问题就不大了，还请各位高手不吝赐教，多多补充完善！</font></p>

<p><img title="Everything is object." style="border-width: 0px;" alt="Everything is object." src="everythingisobject_3.jpg" border="0" height="420" width="520"></p>
<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(1271589,28598,1)"> 
		<span class="diggnum" id="digg_count_1271589">0</span>
	</div>
	<div class="buryit" onclick="DiggIt(1271589,28598,2)"> 
		<span class="burynum" id="bury_count_1271589">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_1271589">0</span>	
	<div class="diggword" id="digg_word_1271589">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270685.html">« </a> 上一篇：<a href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270685.html" title="发布于2008-08-18 23:23">值类型和引用类型的区别</a><br>
<a href="http://www.cnblogs.com/Autumoon/archive/2008/08/26/1276746.html">» </a> 下一篇：<a href="http://www.cnblogs.com/Autumoon/archive/2008/08/26/1276746.html" title="发布于2008-08-26 15:36">寻找失落的SubString</a><br>
</div>








		</div>
		<div class="postDesc">posted @ 2008-08-19 17:40 <a href="http://www.cnblogs.com/Autumoon/">Autumoon</a> 阅读(3461) <a href="#commentform">评论(26)</a> &nbsp;<a href="http://www.cnblogs.com/Autumoon/admin/EditPosts.aspx?postid=1271589">编辑</a> <a href="http://www.cnblogs.com/Autumoon/AddToFavorite.aspx?id=1271589">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  所属分类: <a href="http://www.cnblogs.com/Autumoon/category/151002.html">.NET程序员技术面试迷你手册（C#版）</a></div>
	</div>
	<img src="1271589.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html"
dc:identifier="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/Autumoon/services/trackbacks/1271589.aspx" />
</rdf:RDF>
-->

</div><!--end: topics 文章、评论容器-->
<a name="pagedcomment"></a>
<!--done-->
<br>
<div class="feedback_area_title">发表评论</div>
<div class="feedbackNoItems"><span id="span_comment_maxid" style="display: none;">1450017</span></div>
	

		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Jeffrey.Sky",1291640,"OZI/XTMNRlOi7D0IMKE8kDEDujbmkG3Su8VKKpw1v+xot41HiTk+Tw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291640,"OZI/XTMNRlOi7D0IMKE8kDEDujbmkG3Su8VKKpw1v+xot41HiTk+Tw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Jeffrey.Sky" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291640">#1楼</a><a name="1291640" id="comment_anchor_1291640"></a>2008-08-19 18:45 | <a id="Comments1_CommentList_ctl00_NameLink" href="http://www.cnblogs.com/czk55/" target="_top">Jeffrey.Sky</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Jeffrey.Sky" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291640" class="blog_comment_body">这是我们首先要掌握的</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("路西菲尔",1291663,"8r8V2i9V88OFtcikslaEaQ+DDvkL+ARIX9/MxGCIfnRI3qsIX6LEqw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291663,"8r8V2i9V88OFtcikslaEaQ+DDvkL+ARIX9/MxGCIfnRI3qsIX6LEqw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%b7%af%e8%a5%bf%e8%8f%b2%e5%b0%94" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291663">#2楼</a><a name="1291663" id="comment_anchor_1291663"></a>2008-08-19 19:27 | <a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/hd700/" target="_top">路西菲尔</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%b7%af%e8%a5%bf%e8%8f%b2%e5%b0%94" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291663" class="blog_comment_body">调用dragon.Fly方法时，编译器会顺着继承链往下找，一直找到合适的那个方法体
<br>=====================================
<br>编译器查找？override不是运行时概念吗</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("亚历山大同志",1291667,"A0HWFeL2VzPLtePG9xKLxYe123aPyflYe0acI+TfojLceT0pSrwf3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291667,"A0HWFeL2VzPLtePG9xKLxYe123aPyflYe0acI+TfojLceT0pSrwf3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%ba%9a%e5%8e%86%e5%b1%b1%e5%a4%a7%e5%90%8c%e5%bf%97" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291667">#3楼</a><a name="1291667" id="comment_anchor_1291667"></a>2008-08-19 19:32 | <a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/Alexander-Lee/" target="_top">亚历山大同志</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%ba%9a%e5%8e%86%e5%b1%b1%e5%a4%a7%e5%90%8c%e5%bf%97" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291667" class="blog_comment_body">这三个只是面向对象最主要的特征，而面向对象最重要的是要掌握下面这些设计原则：<br>开闭原则<br>里氏代换原则<br>依赖倒转原则<br>接口隔离原则<br>组合/聚合复用原则<br>迪米特法则<br>这些才是学习面向对象应该去主要了解掌握的。<br>封装、继承、多态老实说太浅了一点</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("亚历山大同志",1291668,"A0HWFeL2VzPLtePG9xKLxYe123aPyflYe0acI+TfojLceT0pSrwf3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291668,"A0HWFeL2VzPLtePG9xKLxYe123aPyflYe0acI+TfojLceT0pSrwf3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%ba%9a%e5%8e%86%e5%b1%b1%e5%a4%a7%e5%90%8c%e5%bf%97" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291668">#4楼</a><a name="1291668" id="comment_anchor_1291668"></a>2008-08-19 19:33 | <a id="Comments1_CommentList_ctl03_NameLink" href="http://www.cnblogs.com/Alexander-Lee/" target="_top">亚历山大同志</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%ba%9a%e5%8e%86%e5%b1%b1%e5%a4%a7%e5%90%8c%e5%bf%97" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291668" class="blog_comment_body">@路西菲尔<br>override是编译时的，反射才是运行时的</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Alone",1291682,"jbArbSsddP6o9KDtZIGFVCJJzjO86u4hNExuoYZhFLNVcjSl+mT7ZQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291682,"jbArbSsddP6o9KDtZIGFVCJJzjO86u4hNExuoYZhFLNVcjSl+mT7ZQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Alone" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291682">#5楼</a><a name="1291682" id="comment_anchor_1291682"></a>2008-08-19 20:06 | <a id="Comments1_CommentList_ctl04_NameLink" href="http://www.cnblogs.com/alone7/" target="_top">Alone</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Alone" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291682" class="blog_comment_body">貌似和我读得 C#本质论 内容相似</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Autumoon",1291708,"M6sed0jREdUJvqEIDK6Tcwj6B9iFJq2qtJqYsoSPdqAKnXcYRqIo3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291708,"M6sed0jREdUJvqEIDK6Tcwj6B9iFJq2qtJqYsoSPdqAKnXcYRqIo3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Autumoon" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291708">#6楼</a><a name="1291708" id="comment_anchor_1291708"></a>[<span class="louzhu">楼主</span>]2008-08-19 20:48 | <a id="Comments1_CommentList_ctl05_NameLink" href="http://www.cnblogs.com/Autumoon/" target="_top">Autumoon</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Autumoon" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291708" class="blog_comment_body">@亚历山大同志
<br>
<br>谢谢，不过我这个系列主要把握的水平就是面试通常的水平，请注意看看我的序言中的内容。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Myhsg",1291713,"lNuDQCTGbImEORqZsIdWPOBI5qi/MN05c1xaPlVoEzx0oPYLa/TD3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291713,"lNuDQCTGbImEORqZsIdWPOBI5qi/MN05c1xaPlVoEzx0oPYLa/TD3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Myhsg" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291713">#7楼</a><a name="1291713" id="comment_anchor_1291713"></a>2008-08-19 20:54 | <a id="Comments1_CommentList_ctl06_NameLink" href="http://www.cnblogs.com/Myhsg/" target="_top">Myhsg</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Myhsg" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291713" class="blog_comment_body">博客园好文很多，
<br><br>每次都想看完
<br><br>上博客园真“累”
<br><br>:-)</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("路西菲尔",1291763,"8r8V2i9V88OFtcikslaEaQ+DDvkL+ARIX9/MxGCIfnRI3qsIX6LEqw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291763,"8r8V2i9V88OFtcikslaEaQ+DDvkL+ARIX9/MxGCIfnRI3qsIX6LEqw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%b7%af%e8%a5%bf%e8%8f%b2%e5%b0%94" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291763">#8楼</a><a name="1291763" id="comment_anchor_1291763"></a>2008-08-19 22:12 | <a id="Comments1_CommentList_ctl07_NameLink" href="http://www.cnblogs.com/hd700/" target="_top">路西菲尔</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%b7%af%e8%a5%bf%e8%8f%b2%e5%b0%94" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291763" class="blog_comment_body">@亚历山大同志
<br>我是说，博主为什么说编译器动态查找继承链的，这是什么理论</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("codemo",1291798,"sDTx1g2vWXgeJRYDLwDzgTSyFcAggO2wfKWmmvsLdDwcsNuof0F7VQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291798,"sDTx1g2vWXgeJRYDLwDzgTSyFcAggO2wfKWmmvsLdDwcsNuof0F7VQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=codemo" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291798">#9楼</a><a name="1291798" id="comment_anchor_1291798"></a>2008-08-19 22:58 | <a id="Comments1_CommentList_ctl08_NameLink" href="http://www.cnblogs.com/codemo/" target="_top">codemo</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/codemo" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291798" class="blog_comment_body">讲的还不错！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("guojing",1291805,"LPkbuKPXzMajAPa9oIiQHT1JPQhNelKyK+dNryZMcDWhGd2OQyprgw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291805,"LPkbuKPXzMajAPa9oIiQHT1JPQhNelKyK+dNryZMcDWhGd2OQyprgw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=guojing" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291805">#10楼</a><a name="1291805" id="comment_anchor_1291805"></a>2008-08-19 23:06 | <a id="Comments1_CommentList_ctl09_NameLink" href="http://www.cnblogs.com/soundbbg/" target="_top">guojing</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/guojing" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291805" class="blog_comment_body">有点意思 支持lz</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("亚历山大同志",1291811,"A0HWFeL2VzPLtePG9xKLxYe123aPyflYe0acI+TfojLceT0pSrwf3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291811,"A0HWFeL2VzPLtePG9xKLxYe123aPyflYe0acI+TfojLceT0pSrwf3g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e4%ba%9a%e5%8e%86%e5%b1%b1%e5%a4%a7%e5%90%8c%e5%bf%97" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291811">#11楼</a><a name="1291811" id="comment_anchor_1291811"></a>2008-08-19 23:18 | <a id="Comments1_CommentList_ctl10_NameLink" href="http://www.cnblogs.com/Alexander-Lee/" target="_top">亚历山大同志</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e4%ba%9a%e5%8e%86%e5%b1%b1%e5%a4%a7%e5%90%8c%e5%bf%97" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291811" class="blog_comment_body">@路西菲尔<br>这个特征特现了C#编译器对里氏代换原则的支持。也就是：凡是基类适用的地方子类一定适用。<br>比如class Base，class Sub:base<br>如果：Base a=new Sub();<br>那么实际上编译器已经能够确定a所指向的对象的类型。所以方法的地址确实是在编译期就确定了的。<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("路西菲尔",1291813,"8r8V2i9V88OFtcikslaEaQ+DDvkL+ARIX9/MxGCIfnRI3qsIX6LEqw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291813,"8r8V2i9V88OFtcikslaEaQ+DDvkL+ARIX9/MxGCIfnRI3qsIX6LEqw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e8%b7%af%e8%a5%bf%e8%8f%b2%e5%b0%94" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291813">#12楼</a><a name="1291813" id="comment_anchor_1291813"></a>2008-08-19 23:34 | <a id="Comments1_CommentList_ctl11_NameLink" href="http://www.cnblogs.com/hd700/" target="_top">路西菲尔</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e8%b7%af%e8%a5%bf%e8%8f%b2%e5%b0%94" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291813" class="blog_comment_body">@ 亚历山大同志
<br>这跟里氏代换原则没多大关系。
<br>class Base，class Sub:base 都有方法Foo().
<br>
<br>Base a=new Sub(); 
<br>a.Foo(); 
<br>编译器就知道Callvirt Base::Foo.
<br>Foo是虚还是非虚编译器不管，在Jit的时候才关心</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("非空",1291896,"say9vGz+ngKbdMdLpTGryqq6BXrE747j4ZHim3pEfYQcAqg22wW0tw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1291896,"say9vGz+ngKbdMdLpTGryqq6BXrE747j4ZHim3pEfYQcAqg22wW0tw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e9%9d%9e%e7%a9%ba" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1291896">#13楼</a><a name="1291896" id="comment_anchor_1291896"></a>2008-08-20 08:24 | <a id="Comments1_CommentList_ctl12_NameLink" href="http://www.cnblogs.com/DreamWork/" target="_top">非空</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e9%9d%9e%e7%a9%ba" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1291896" class="blog_comment_body">我是来看楼主最后那图的o(∩_∩)o...哈哈</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("时间太快",1292134,"PTsNPVKehVZ2uJ4fbpWQFcv30CvEXrR3jWVBPzlXdReU82PN6hEy0g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292134,"PTsNPVKehVZ2uJ4fbpWQFcv30CvEXrR3jWVBPzlXdReU82PN6hEy0g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%97%b6%e9%97%b4%e5%a4%aa%e5%bf%ab" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292134">#14楼</a><a name="1292134" id="comment_anchor_1292134"></a>2008-08-20 10:46 | <a id="Comments1_CommentList_ctl13_NameLink" target="_blank">时间太快</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%97%b6%e9%97%b4%e5%a4%aa%e5%bf%ab" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292134" class="blog_comment_body"> Dragon dragon = new DragonSonB();  
<br> dragon.Fly();
<br>
<br>这样声明对象，如果DragonSonB有其它方法，那dragon就无法调用了。。
<br>比如
<br>public class DragonSonB:Dragon
<br>{
<br>   public override void Fly()
<br>   {
<br>
<br>   }
<br>   public void Study()
<br>   {
<br>
<br>   }
<br>}
<br>所以我现在想搞明白的是：
<br>Dragon dragon = new DragonSonB();和
<br>DragonB dragon = new DragonSonB();这样有什么大的区别？？
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("炭炭",1292135,"EhuzwFOJ+kVWRkHydwM1sMxa/LpepTbwP6t070kNk7NidlAhsPLxYQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292135,"EhuzwFOJ+kVWRkHydwM1sMxa/LpepTbwP6t070kNk7NidlAhsPLxYQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%82%ad%e7%82%ad" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292135">#15楼</a><a name="1292135" id="comment_anchor_1292135"></a>2008-08-20 10:47 | <a id="Comments1_CommentList_ctl14_NameLink" href="http://www.cnblogs.com/waitrabbit/" target="_top">炭炭</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%82%ad%e7%82%ad" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292135" class="blog_comment_body">Dragon dragon = new DragonSonB();   
<br>
<br>-----
<br>试想我不知道DragonSonB()，怎么写出这句呢？你还是没解释透阿，呵呵</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("炭炭",1292141,"EhuzwFOJ+kVWRkHydwM1sMxa/LpepTbwP6t070kNk7NidlAhsPLxYQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292141,"EhuzwFOJ+kVWRkHydwM1sMxa/LpepTbwP6t070kNk7NidlAhsPLxYQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%82%ad%e7%82%ad" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292141">#16楼</a><a name="1292141" id="comment_anchor_1292141"></a>2008-08-20 10:50 | <a id="Comments1_CommentList_ctl15_NameLink" href="http://www.cnblogs.com/waitrabbit/" target="_top">炭炭</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%82%ad%e7%82%ad" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292141" class="blog_comment_body">@时间太快
<br>
<br>干脆我说了吧，Dragon dragon = new DragonSonB(); 这句话是没有意义的，后面应该用不是new的返回对象的方法，比如类工厂，才能真正实现多态！
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("xingyunet",1292176,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292176,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292176">#17楼</a><a name="1292176" id="comment_anchor_1292176"></a> 124.114.234.* 2008-08-20 11:11 | <a id="Comments1_CommentList_ctl16_NameLink" target="_blank">xingyunet[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292176" class="blog_comment_body">    虽然很简单！但看完就懂了！很贴近生活！</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("时间太快",1292228,"PTsNPVKehVZ2uJ4fbpWQFcv30CvEXrR3jWVBPzlXdReU82PN6hEy0g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292228,"PTsNPVKehVZ2uJ4fbpWQFcv30CvEXrR3jWVBPzlXdReU82PN6hEy0g==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e6%97%b6%e9%97%b4%e5%a4%aa%e5%bf%ab" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292228">#18楼</a><a name="1292228" id="comment_anchor_1292228"></a>2008-08-20 11:45 | <a id="Comments1_CommentList_ctl17_NameLink" target="_blank">时间太快</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e6%97%b6%e9%97%b4%e5%a4%aa%e5%bf%ab" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292228" class="blog_comment_body">@炭炭
<br>也就是说Dragon dragon = new DragonSonB(); 这种方法没什么用，还不如用DragonB dragon = new DragonSonB();
<br>如果用工厂模式这样做。
<br>Factory Dragon＝Factory.GetDragonB();
<br>这也许有点看头。。。
<br></span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("炭炭",1292341,"EhuzwFOJ+kVWRkHydwM1sMxa/LpepTbwP6t070kNk7NidlAhsPLxYQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292341,"EhuzwFOJ+kVWRkHydwM1sMxa/LpepTbwP6t070kNk7NidlAhsPLxYQ==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e7%82%ad%e7%82%ad" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292341">#19楼</a><a name="1292341" id="comment_anchor_1292341"></a>2008-08-20 13:40 | <a id="Comments1_CommentList_ctl18_NameLink" href="http://www.cnblogs.com/waitrabbit/" target="_top">炭炭</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e7%82%ad%e7%82%ad" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292341" class="blog_comment_body">@时间太快
<br>
<br>正是这样，试想我们知道了DragonSonB()为什么不直接DragonB dragon = new DragonSonB()呢？
<br>事实是我们在写基类逻辑时是不知道将来有什么子类，以及哪个子类会执行我的调用的。但是基类的逻辑又是不需要关心这个问题的，这才是多态的意义。往深里说就是要实现OCP
<br>Dragon dragon = new DragonSonB() 这一句涌来解释多态是不合适的，因为你已经表明了要用DragonSonB方法而不是多态方法。
<br>解释多态，教科书里比较常用的方法是调用放在一个集合里的子类,写形如
<br>
<br>foreach dragon dr in drangoList { ... } 的代码。
<br>
<br>实际工作中，比较多的就是类工厂了。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("@我本善良",1292374,"nXkmijkMC8nbZOITKuOqH7Bp9Sx2a38dPCc/qvltA9bUxbBLpWZQSw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292374,"nXkmijkMC8nbZOITKuOqH7Bp9Sx2a38dPCc/qvltA9bUxbBLpWZQSw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%40%e6%88%91%e6%9c%ac%e5%96%84%e8%89%af" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292374">#20楼</a><a name="1292374" id="comment_anchor_1292374"></a>2008-08-20 14:07 | <a id="Comments1_CommentList_ctl19_NameLink" href="http://www.cnblogs.com/cdwin/" target="_top">@我本善良</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%40%e6%88%91%e6%9c%ac%e5%96%84%e8%89%af" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292374" class="blog_comment_body">Encapsulation</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Ivony...",1292377,"QIfmn2VAQC6L9aaG/ZY1rpX5le6OShn0cj2iC2NAoE4np9dRng9u8w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292377,"QIfmn2VAQC6L9aaG/ZY1rpX5le6OShn0cj2iC2NAoE4np9dRng9u8w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Ivony..." target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292377">#21楼</a><a name="1292377" id="comment_anchor_1292377"></a>2008-08-20 14:12 | <a id="Comments1_CommentList_ctl20_NameLink" href="http://www.cnblogs.com/Ivony/" target="_top">Ivony...</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Ivony..." title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292377" class="blog_comment_body">关于封装的部分非常不错……</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Ivony...",1292378,"QIfmn2VAQC6L9aaG/ZY1rpX5le6OShn0cj2iC2NAoE4np9dRng9u8w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1292378,"QIfmn2VAQC6L9aaG/ZY1rpX5le6OShn0cj2iC2NAoE4np9dRng9u8w==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Ivony..." target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1292378">#22楼</a><a name="1292378" id="comment_anchor_1292378"></a>2008-08-20 14:12 | <a id="Comments1_CommentList_ctl21_NameLink" href="http://www.cnblogs.com/Ivony/" target="_top">Ivony...</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Ivony..." title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1292378" class="blog_comment_body">--引用--------------------------------------------------
<br>亚历山大同志: 这三个只是面向对象最主要的特征，而面向对象最重要的是要掌握下面这些设计原则：
<br>开闭原则
<br>里氏代换原则
<br>依赖倒转原则
<br>接口隔离原则
<br>组合/聚合复用原则
<br>迪米特法则
<br>这些才是学习面向对象应该去主要了解掌握的。
<br>封装、继承、多态老实说太浅了一点
<br>--------------------------------------------------------
<br>
<br>
<br>不是把书背下来就可以写好程序的。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("RyanXM",1332052,"cNlxKmchg3zalNRYjzzi76BSZoVcdmp2xSAqDV49MHOTc1cCncVtAw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1332052,"cNlxKmchg3zalNRYjzzi76BSZoVcdmp2xSAqDV49MHOTc1cCncVtAw==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=RyanXM" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1332052">#23楼</a><a name="1332052" id="comment_anchor_1332052"></a>2008-10-05 16:57 | <a id="Comments1_CommentList_ctl22_NameLink" href="http://www.cnblogs.com/atlantic/" target="_top">RyanXM</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/RyanXM" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1332052" class="blog_comment_body">--引用--------------------------------------------------
<br>亚历山大同志: @路西菲尔
<br>override是编译时的，反射才是运行时的
<br>--------------------------------------------------------
<br>
<br>"在.NET中，覆写实现了运行时的多态性，而重载实现了编译时的多态性。"
<br>
<br>那这句话的说法对不对?</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("Autumoon",1340910,"M6sed0jREdUJvqEIDK6Tcwj6B9iFJq2qtJqYsoSPdqAKnXcYRqIo3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1340910,"M6sed0jREdUJvqEIDK6Tcwj6B9iFJq2qtJqYsoSPdqAKnXcYRqIo3A==")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=Autumoon" target="_top">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1340910">#24楼</a><a name="1340910" id="comment_anchor_1340910"></a>[<span class="louzhu">楼主</span>]2008-10-15 06:28 | <a id="Comments1_CommentList_ctl23_NameLink" href="http://www.cnblogs.com/Autumoon/" target="_top">Autumoon</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/Autumoon" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1340910" class="blog_comment_body">@RyanXM
<br>
<br>“在.NET中，覆写实现了运行时的多态性，而重载实现了编译时的多态性。”我认为这句话是指将“override是编译时的，反射才是运行时的”的说法更加学术化了一点儿而已，我个人认为，“多态”是思维层面的东西，不必要非要分一个运行时或编译时，我觉得，如果一定要把它归为哪个时的话，那还是列为“设计时”比较合适，呵呵。</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("你亲爹",1351582,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1351582,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1351582">#25楼</a><a name="1351582" id="comment_anchor_1351582"></a> 125.33.143.* 2008-10-26 12:08 | <a id="Comments1_CommentList_ctl24_NameLink" target="_blank">你亲爹[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1351582" class="blog_comment_body">@亚历山大同志
<br>你这个人就是看不得别人好是不是</span><br>
			</div>
		</div>
	
		<div class="feedbackItem">
			<div class="feedbackListSubtitle">
				<div class="feedbackManage">
					&nbsp;&nbsp;<a onclick='ReplyComment("fresh-man",1450017,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1450017,"")' href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html#commentform">引用</a>&nbsp;&nbsp;&nbsp;&nbsp;
				</div>
				<a href="#1450017">#26楼</a><a name="1450017" id="comment_anchor_1450017"></a> 199.64.0.* <a name="Post"></a>2009-02-13 10:17 | <a id="Comments1_CommentList_ctl25_NameLink" target="_blank">fresh-man[未注册用户]</a>
			</div>
			<div class="feedbackCon">
				<span id="comment_body_1450017" class="blog_comment_body">写得很好！希望能写更多更具体的！谢谢啦</span><br>
			</div>
		</div>
	

<div id="comment_form" class="commentform">



<div id="divCommentShow"></div>
<div id="comment_nav" style="text-align: right;"><span id="span_refresh_tips"></span><a href="###" onclick="return RefreshCommentList(1271589);" name="commentform" id="lnk_RefreshComments">刷新评论列表</a>&nbsp; <a href="###" onclick="return RefreshPage();">刷新页面</a>&nbsp; <a href="#top">返回页首</a></div>
<div id="commentform_title">发表评论 <span class="ad_commentbox_up"><a href="http://www.cnblogs.com/" target="_top">博客园首页</a>&nbsp; <a href="http://news.cnblogs.com/" target="_top">IT新闻</a>&nbsp; <a href="http://home.cnblogs.com/ing/" target="_top">闪存</a>&nbsp; <a href="http://job.cnblogs.com/" target="_top">招聘</a>&nbsp; <a href="http://a4.yeshj.com/rd/34143/" target="_top">学英语</a></span></div>
<span id="tip_comment" style="color: Red;"></span>
<p>
昵称：<input name="ctl05$tbCommentAuthor" id="ctl05_tbCommentAuthor" class="author" value="解然" disabled="disabled" type="text">
</p>
<p>
主页：<input name="ctl05$tbCommentAuthorUrl" id="ctl05_tbCommentAuthorUrl" class="url" value="http://www.cnblogs.com/xieran/" disabled="disabled" type="text">
</p>
<p>
</p><div class="commentbox_title">
<div class="commentbox_title_left">评论内容：</div>
<div class="commentbox_title_right">
<img id="ubb_quote" class="comment_icon" src="quote.gif" alt="引用" title="添加引用" onclick="insertUBB('tbCommentBody','quote')">
<img id="ubb_bold" class="comment_icon" src="b.png" alt="粗体" title="添加粗体" onclick="insertUBB('tbCommentBody','b')">
<img id="ubb_url" class="comment_icon" src="lk.png" alt="链接" title="添加链接" onclick="insertUbbUrl('tbCommentBody')">
<img id="ubb_indent" class="comment_icon" src="indent.png" alt="缩进" title="添加首行缩进" onclick="insertIndent('tbCommentBody')">
<img id="ubb_img" class="comment_icon" src="img.gif" alt="图片" title="添加图片" onclick="insertUbbImg('tbCommentBody')">
<img id="ubb_code" class="comment_icon" style="" src="insertcode.gif" alt="代码" title="添加代码" onclick="insertUbbCode()">
</div>
</div>
<div class="clear"></div>
<textarea id="tbCommentBody" class="comment_textarea" onkeydown="return clt_enter(event)"></textarea>

<p>
<input id="btn_comment_submit" class="comment_btn" value="提交" onclick="PostComment();return false;" type="button">
&nbsp;&nbsp;<span id="span_comment_canceledit" style="display: none;"><a href="###" onclick="return CancelCommentEdit()">不改了</a>&nbsp;&nbsp;</span><a href="http://passport.cnblogs.com/logout.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fAutumoon%2farchive%2f2008%2f08%2f19%2f1271589.html%3flogout%3d1%23commentform" onclick="return confirm('确认注销吗？')">注销</a>&nbsp;&nbsp;<a id="ctl05_lnkSubscribe" title="邮件订阅回复通知" onclick="return SubscribeComment();" href="http://www.cnblogs.com/UI/Controls/#%23%23">订阅回复</a>
</p>
<p>
[使用Ctrl+Enter键快速提交]
</p>
<div style="display: none;">
<span id="comment_edit_id"></span><span id="span_parentcomment_id">0</span>
<span id="span_parent_id">1271589</span>
<span id="span_comment_replyto"></span>
<span id="span_comment_title">面向对象主要概念</span>
<span id="span_comment_posted"></span>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55140/" target="_top">《星际争霸2》"刀锋女王"重金属主题音乐视频</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55139/" target="_top">中国站长最郁闷的几件事情</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55138/" target="_top">苹果Vs谷歌：手机领域谁怕谁？</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55137/" target="_top">摩托罗拉：豪赌Android的希望与隐忧</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55136/" target="_top">分众新坐标：楼宇是过去 未来在手机和互联网</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_1.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>


<div id="div_commentbox_nav" class="c_ad_block">
链接：<a href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html?switchskin=1#skinlist">切换模板</a><br>
</div>
<div id="relative_search"><br><b>相关搜索:</b><br> <a href="http://zzk.cnblogs.com/s?w=.NET%e7%a8%8b%e5%ba%8f%e5%91%98%e6%8a%80%e6%9c%af%e9%9d%a2%e8%af%95%e8%bf%b7%e4%bd%a0%e6%89%8b%e5%86%8c%ef%bc%88C%23%e7%89%88%ef%bc%89" target="_top">.NET程序员技术面试迷你手册（C#版）</a> </div><div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/1271589/">面向对象主要概念</a></div>

</div>




				
	</div><!--end: forFlow -->
	</div><!--end: mainContent 主体内容容器-->

	<div id="sideBar">
		<div id="sideBarMain">
			
<!--done-->
<div class="newsItem">
<h3 class="catListTitle">公告</h3>
	<p align="center"><embed src="world001-blue.swf" type="application/x-shockwave-flash" wmode="transparent" height="92" width="175"><br>
<br>
Since&nbsp;May 31, 1998.<br><!--<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#88;&#105;&#110;&#119;&#101;&#110;&#67;&#104;&#101;&#110;&#103;&#64;&#103;&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;"><img height=21 alt="" src="http://images.cnblogs.com/cnblogs_com/zerocool/MyGmailLink.png" width=175 border=0 /></a><br/><br/>--><img src="r_mvp.png" alt="MVP (Visual C#)"><br><br></p><div style=""><table style="" cellpadding="4" cellspacing="0"><tbody><tr align="center"><td style=""><a href="http://www.douban.com/subject/1085660/" title="尽管去做

Getting Things Done The Art of Stress-free Productivity" target="_top"><img src="s1796471.jpg" border="0"></a></td><td style=""><a href="http://www.douban.com/subject/3696561/" title="世界又热又平又挤" target="_top"><img src="s3763074.jpg" border="0"></a></td></tr><tr align="center"><td style=""><a href="http://www.douban.com/subject/3883231/" title="Pro Silverlight 3 in C#" target="_top"><img src="s3900991.jpg" border="0"></a></td><td style=""><a href="http://www.douban.com/subject/1477390/" title="代码大全（第2版）" target="_top"><img src="s1495029.jpg" border="0"></a></td></tr><tr align="center"><td style=""><a href="http://www.douban.com/subject/1136852/" title="南怀瑾选集（第三卷）" target="_top"><img src="s2177899.jpg" border="0"></a></td></tr><tr><td colspan="2" align="center"><a href="http://www.douban.com/people/XinwenCheng/" target="_top">我的豆瓣主页</a></td></tr></tbody></table></div><br><div id="profile_block"><a href="http://home.cnblogs.com/Autumoon/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/Autumoon/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/Autumoon/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/Autumoon" target="_top">发短消息</a></div>
</div>

			<div id="calendar"></div>
			
			<div id="leftcontentcontainer">
				
<div class="catListPostCategory">
<h3 class="catListTitle">随笔分类<span style="font-size: 11px; font-weight: normal;">(69)</span></h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/Autumoon/category/151002.html">.NET程序员技术面试迷你手册（C#版）(5)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to .NET程序员技术面试迷你手册（C#版）(5)" href="http://www.cnblogs.com/Autumoon/category/151002.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/Autumoon/category/102693.html">Autumoon Code Library(1)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to Autumoon Code Library(1)" href="http://www.cnblogs.com/Autumoon/category/102693.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/Autumoon/category/112473.html">C# 3.0 探索之旅(9)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to C# 3.0 探索之旅(9)" href="http://www.cnblogs.com/Autumoon/category/112473.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/Autumoon/category/113499.html">LINQ 探索之旅(5)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to LINQ 探索之旅(5)" href="http://www.cnblogs.com/Autumoon/category/113499.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_Link" href="http://www.cnblogs.com/Autumoon/category/158314.html">Office Live for Small Business(4)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl05_RssLink" title="Subscribe to Office Live for Small Business(4)" href="http://www.cnblogs.com/Autumoon/category/158314.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_Link" href="http://www.cnblogs.com/Autumoon/category/131874.html">白话C#系列(8)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl06_RssLink" title="Subscribe to 白话C#系列(8)" href="http://www.cnblogs.com/Autumoon/category/131874.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_Link" href="http://www.cnblogs.com/Autumoon/category/221050.html">读书笔记(1)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl07_RssLink" title="Subscribe to 读书笔记(1)" href="http://www.cnblogs.com/Autumoon/category/221050.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_Link" href="http://www.cnblogs.com/Autumoon/category/141025.html">多普达 Touch Diamond 创新前沿体验(4)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl08_RssLink" title="Subscribe to 多普达 Touch Diamond 创新前沿体验(4)" href="http://www.cnblogs.com/Autumoon/category/141025.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_Link" href="http://www.cnblogs.com/Autumoon/category/102692.html">公告(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl09_RssLink" title="Subscribe to 公告(2)" href="http://www.cnblogs.com/Autumoon/category/102692.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_Link" href="http://www.cnblogs.com/Autumoon/category/102688.html">技术杂文(3)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl10_RssLink" title="Subscribe to 技术杂文(3)" href="http://www.cnblogs.com/Autumoon/category/102688.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_Link" href="http://www.cnblogs.com/Autumoon/category/114802.html">简明设计模式——C#版(25)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl11_RssLink" title="Subscribe to 简明设计模式——C#版(25)" href="http://www.cnblogs.com/Autumoon/category/114802.html/rss">(rss)</a></li>

<li><a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_Link" href="http://www.cnblogs.com/Autumoon/category/228064.html">时间管理(2)</a> <a id="SingleColumn1_Categories_CatList_ctl00_LinkList_ctl12_RssLink" title="Subscribe to 时间管理(2)" href="http://www.cnblogs.com/Autumoon/category/228064.html/rss">(rss)</a></li>

</ul>

</div>

<div class="catList">
<h3 class="catListTitle">友情链接</h3>

<ul>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.codeplex.com/site/users/view/Autumoon" target="_top">Autumoon @ CodePlex</a> </li>

<li><a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://zerocool.cnblogs.com/" target="_top">作者博客</a> <a id="SingleColumn1_Categories_CatList_ctl01_LinkList_ctl02_RssLink" title="Subscribe to 作者博客" href="http://www.cnblogs.com/ZeroCool/rss">(rss)</a></li>
<li style="margin-top: 2px;">/* ZeroCool的个人博客 */</li>
</ul>

</div>



<div class="catListComment">
<h3 class="catListTitle">最新评论<a id="SingleColumn1__3514896_RSSHyperlink1" title="RSS订阅最最新评论" href="http://www.cnblogs.com/Autumoon/CommentsRSS.aspx"><img title="RSS订阅最最新评论" src="xml.gif" style="border-width: 0px;"></a></h3>

	
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl00_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270558.html#1748817">1.&nbsp;Re:序</a>
			</div>
			<div class="divRecentComment">
				基础的东西很重要，往往出的Bug都是这些导致的，其实软件开发最重要的思想，单基础概念同样不可忽视。 (寒枫)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl01_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/17/1649909.html#1748760">2.&nbsp;Re:把时间管理培养成习惯</a>
			</div>
			<div class="divRecentComment">
				nice article (王德水)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl02_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/17/1649909.html#1748755">3.&nbsp;Re:把时间管理培养成习惯</a>
			</div>
			<div class="divRecentComment">
				地板，呵！道理浅显易懂，但很少人会这样进行时间管理，往往是做事前稍微考虑一下。养成好的习惯的确很重要。 (GoodGF)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl03_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/17/1649909.html#1748728">4.&nbsp;Re:把时间管理培养成习惯</a>
			</div>
			<div class="divRecentComment">
				好文章 (长河落日)
			</div>		
		
			<div class="divRecentCommentAticle">
				<a id="SingleColumn1__3514896_CommentList_ctl04_Hyperlink2" class="listitem" href="http://www.cnblogs.com/Autumoon/archive/2010/01/09/1642846.html#1743368">5.&nbsp;Re:时间管理——被忽视的重要理念！</a>
			</div>
			<div class="divRecentComment">
				管理时间最有效的方法，就是建立良好的生活规律！

当我们手中握有大把的时间时，效率却不一定高；反之，在挤出的时间里，恰恰相反！
 (卡通一下)
			</div>		
		
</div>

<div class="catListView">
<h3 class="catListTitle">阅读排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html">1.&nbsp;多线程(5900)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html">2.&nbsp;面向对象主要概念(3461)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/06/23/1228335.html">3.&nbsp;反射(3172)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270685.html">4.&nbsp;值类型和引用类型的区别(3055)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl02_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/07/01/1233476.html">5.&nbsp;Touch Diamond Remote —— 世界就在指尖(2898)</a>
			</li>
		
			</ul>
		
</div>

<div class="catListFeedback">
<h3 class="catListTitle">评论排行榜</h3>
	
			<ul>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/07/01/1233476.html">1.&nbsp;Touch Diamond Remote —— 世界就在指尖(38)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/06/19/1225684.html">2.&nbsp;多线程(35)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/19/1271589.html">3.&nbsp;面向对象主要概念(26)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/26/1276746.html">4.&nbsp;寻找失落的SubString(23)</a>
			</li>
		
			<li>
				<a id="SingleColumn1_ctl03_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/Autumoon/archive/2008/08/18/1270685.html">5.&nbsp;值类型和引用类型的区别(20)</a>
			</li>
		
			</ul>
		
</div>

				
<div id="blog_ad_google">
<h3>Google广告</h3>
<ul>
<li>

<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 250px; position: relative; visibility: visible; width: 300px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 250px; position: relative; visibility: visible; width: 300px;"><iframe allowtransparency="true" hspace="0" id="google_ads_frame3" marginheight="0" marginwidth="0" name="google_ads_frame" src="index_3.html" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" scrolling="no" frameborder="0" height="250" width="300"></iframe></ins></ins>
</li>
</ul>
</div>
			</div>
			
		</div><!--end: sideBarMain -->
	</div><!--end: sideBar 侧边栏容器 -->
	<div class="clear"></div>
	</div><!--end: main -->
	<div class="clear"></div>
	<div id="footer">
		
<!--done-->
Copyright ©2010 Autumoon
	</div><!--end: footer -->
</div><!--end: home 自定义的最大容器 -->
    </form>
	
	
      
    
    
    
</body>
</html>
